#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int tmp1[100] = { 0 };
int tmp2[100] = { 0 };
int k = 0, w = 0;
void sorted(int arr[],int n)
{
	for (int i = 0; i < n; i++)
	{
		if (arr[i] % 2 != 0)
			tmp1[k++] = arr[i];
		else tmp2[w++] = arr[i];
	}
	int i = 0;
	for (int i = 0; i < k; i++)
	{
		arr[i] = tmp1[i];
	}
	for (int i = k, j = 0; j < w; j++,i++)
	{
		arr[i] = tmp2[j];
	}
}
int main()
{
	int arr[100] = { 0 };
	int n = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	sorted(arr, n);
	for (int i = 0; i < n; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}